﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.EventListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%if(Model.Events.Count>0){  %>
<div class="slide_mar">
      <div class="slide_news">
      	<div class="slide">
        	<ul>
            	<%var index = 0;
               var link1 = string.Empty;
               string imgPath = string.Empty;
            	foreach (var item in Model.Events)
                {
                    var css = index == 0 ? "act" : string.Empty;
                    var path = item.Link != null && item.Link != string.Empty ? item.Link : "/product/index/0/0/0/0/" + item.ID;
                    if (index == 0)
                    {
                        imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ?
                            SDT.Lib.Common.Utils.GenThumbnail(item.ID, 325, 259, item.ImagePath, Model.ImagePath, Model.ImageUrl) :
                            SDT.Lib.Common.Globals.DefaultLogo;
                        link1 = path;
                    }
                    index++;
                %>
            	<li>
                	<div><a href="<%=path %>" class="<%=css %>"><%=Html.Encode(item.Title) %></a></div>
                    <p><%=item.Description%></p>
                </li>
                <%} %>
            </ul>
        </div>
      </div>
      <div class="slide_img"><a href="<%=link1 %>"><img src="<%=imgPath %>" width="325" height="259" /></a></div>
  </div>
<%} %>
